﻿using GC_FFW.BusinessEntities.Abstractions.Interfaces.Forecast;
using GC_FFW.BusinessEntities.Forecast.Xml;
using GC_FFW.ForecastWriter.Abstractions.Adapters;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Helpers;

namespace GC_FFW.ForecastWriter.Adapters.TeamMatch.Prognosis
{
	public class EventOfBothToScoreProposalAdapter : ProposalBaseAdapter
	{
		#region Constructors

		public EventOfBothToScoreProposalAdapter(IForecastData forecastData, Conditions conditions,
			IStringManager stringManager, IRandomizer randomizer)
			: base(forecastData, conditions, stringManager, randomizer) { }

		#endregion

		#region Overrides

		public override string GetText()
		{
			if (ForecastData.Coefficients == null || ForecastData.Coefficients.BothToScore == null
				|| ForecastData.Coefficients.BothToScore.FirstCoefficient > 1.8)
				return string.Empty;

			var proposal = GetProposal(Conditions.GetCondition(1));
			return proposal != null && proposal.Text != null ? proposal.Text : string.Empty;
		}

		#endregion
	}
}
